package com.ocom.wxapi.client;


import cn.hutool.db.PageResult;
import com.ocom.common.constant.ActivitiUrl;
import com.ocom.common.request.activiti.*;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.activiti.CompletedTaskVO;
import com.ocom.common.vo.activiti.IncompleteTaskVO;
import com.ocom.common.vo.activiti.PageResultVo;
import com.ocom.common.vo.activiti.SearchFlowVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@FeignClient(value = "activiti")
public interface ActivitiClientService {


//    @PostMapping(ActivitiUrl.URL_OcomSubmitApply)
//    public Result<Map<String,Object>> submitApply(@RequestBody ApplySaveRequest applySaveRequest);

    @PostMapping(ActivitiUrl.URL_OcomCollectingTasks)
    public Result<Boolean> collectingTasks(@RequestBody CollectingTasksRequest request);

    @PostMapping(ActivitiUrl.URL_OcomReturnTask)
    public Result<Boolean> returnTask(@RequestBody ReturnTasksRequest request);

    @PostMapping(ActivitiUrl.URL_OcomHandleTask)
    public Result<HashMap> handleTask(@RequestBody HandleTasksRequest request);

    @PostMapping(ActivitiUrl.URL_OcomPendingTasks)
    public Result<PageResultVo<IncompleteTaskVO>> pendingTasks(@RequestBody PendingTasksRequest request);

    @PostMapping(ActivitiUrl.URL_OcomApproved)
    public Result<PageResultVo<CompletedTaskVO>> approved(@RequestBody ApprovedRequest request);

    @PostMapping(ActivitiUrl.URL_OcomCancelTask)
    public Result<Boolean> cancelApply(@RequestParam("processDefinitionKey")String processDefinitionKey,@RequestParam("businessKey") String businessKey) ;


    @PostMapping(ActivitiUrl.URL_getProcessInfo)
    public Result<List<SearchFlowVo>> getProcessInfo(@RequestParam(value = "processDefinitionKey")String processDefinitionKey,
                                                     @RequestParam(value = "businessKey")String businessKey) ;


}
